package top.auntie.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import top.auntie.bean.RegisterInfo;
import top.auntie.dao.RegisterDao;
import top.auntie.model.Register;
import top.auntie.model.RegisterExample;
import top.auntie.service.RegisterService;

import java.util.List;

@CacheConfig(cacheNames = "reg")
public class RegisterServiceImpl implements RegisterService {

    @Autowired
    private RegisterDao registerDao;

    @Cacheable(key = "")
    @Override
    public Register checkRegister() {
        List<Register> registerList = registerDao.selectByExample(new RegisterExample());
        return registerList.get(0);
    }

/*    public Register register(String userName, String registerCode) {
        Register register = new Register();
        register.setUsername(userName);
        register.setRegistCode(registerCode);
        RegisterInfo registerInfo = decodeRegisterInfo(registerCode, userName);

    }

    private RegisterInfo decodeRegisterInfo(String registerCode, String userName) {

        return null;
    }*/

}
